package com.dc.refactoring._6_处理概括关系._6_ExtractSubclass.step2;

/**
 * Description: 用于专门处理工时报价的情况
 * @author: gdc
 * @date: 2020/12/12
 * @version 1.0
 */
public class LaborItem extends JobItem {


    /*public LaborItem(int unitPrice, int quantity, Employee employee, boolean isLabor) {
        super(unitPrice, quantity, employee, isLabor);
    }*/

    // step 1 修改子类的构造函数
    /*public LaborItem(int quantity, Employee employee) {
        super(0, quantity, employee, true);
    }*/

    // step 4 超类中构造器参数 employee 去除后，对应构造器引用，也需发生修改
    public LaborItem(int quantity, Employee employee) {
        super(0, quantity, true);
    }

    // step 2 使用函数下移，同时将超类中 employee 字段声明为 protected
    public Employee getEmployee() {
        return employee;
    }
}
